package com.qiaoba.module.system.entity.dto;

import cn.hutool.core.lang.RegexPool;
import com.qiaoba.common.base.validate.AddGroup;
import com.qiaoba.common.base.validate.EditGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * 部门 DTO
 *
 * @author ailanyin
 * @date 2023-09-10 15:42:31
 */
@Data
public class SysDeptDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "部门ID")
    @NotNull(message = "部门ID不能为空", groups = {EditGroup.class})
    @Size(max = 20, message = "部门ID不能超过{max}个字符", groups = {EditGroup.class})
    private String deptId;

    @Schema(description = "父部门ID")
    @Size(max = 20, message = "父部门ID不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String parentId;

    @Schema(description = "部门名称")
    @NotBlank(message = "部门名称不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 30, message = "部门名称不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String deptName;

    @Schema(description = "显示顺序")
    @Min(value = 1, message = "排序最小允许: {value}", groups = {AddGroup.class, EditGroup.class})
    private Integer orderNum;

    @Schema(description = "负责人")
    @Size(max = 20, message = "负责人名称不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String leader;

    @Schema(description = "手机号")
    @Pattern(regexp = RegexPool.MOBILE, message = "手机号不合法", groups = {AddGroup.class, EditGroup.class})
    private String phone;

    @Schema(description = "邮箱")
    @Pattern(regexp = RegexPool.EMAIL, message = "邮箱不合法", groups = {AddGroup.class, EditGroup.class})
    private String email;

    @Schema(description = "部门状态:0停用,1正常")
    @NotBlank(message = "状态不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 1, message = "状态不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String status;

    @Schema(description = "备注")
    @Size(max = 500, message = "备注不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String remark;

}
